package com.springcloud.sc.ucpv5.client.application.message.connect;

import com.springcloud.sc.ucpv5.client.application.message.MessageServiceException;

public interface ConnectInterface {
    public final static int ERROR_CODE_TIME_OUT = 6020;// 操作超时

    public final static int ERROR_CODE_TRANSFER_FAIL = 6021;// 通信失败

    public final static int ERROR_CODE_SOCKET_SHUTDOWN = 6022;

    public final static int ERROR_CODE_CONNECT_FAIL = 6023;

    public final static int ERROR_CODE_SEND_MSG_NULL = 6024;

    public final static int ERROR_CODE_WRITE_SOCKET_FAIL = 6025;

    public final static int ERROR_CODE_HLR_DISCONNECT = 6026;

    public final static int ERROR_CODE_SXC_DISCONNECT = 6027;

    public final static int ERROR_CODE_NOT_REGISTER = 6028;

    public final static int ERROR_CODE_OFFLINE_DATA = 6029;

    // 解码失败,可能版本引起的
    public final static int ERROR_CODE_ENCODE_FAIL = 6030;// 通信失败

    public final static int ERROR_CODE_SESSION_ERROR = 10012;

    final static int ERROR_CODE_SESSION_MAX_LIMIT = 6002;// 登录用户到达最大值

    final static byte[] SOCKET_MSG_BEGIN = { 0x7e, (byte) 0xa5 };

    final static byte[] SOCKET_MSG_END = { 0x7e, 0x0d };

    final static int SOCKET_MSG_LENGTH = 2;

    final static int MSG_HEADER_MIN_LEN = 6 * 4;;

    public int internalInit(String strServerIP, int iServerPort, boolean isReconnect) throws MessageServiceException;

    public int writeByteMsg(byte[] content);

    public void close();

    public boolean checkConnectOk();

    public void setConnnectClose();

    public boolean isLocalPortRight();

    public byte[] readSocket(int len);

    public boolean isDatAvailable();
    
    public void checkShakeHand();
}
